﻿@{
    ViewBag.Title = "QUnit Example";
    Layout = "~/Views/Shared/_Layout.Test.cshtml";
}
@CoffeeScripts.Render("~/CoffeeScripts/shared/coffee")       

<script type="text/coffeescript">
    test("Test without paginate", () -> 
        Link = Cofe.Link
        
        param = "{cofe}/test"
        link1 = Link.fromPath(param)        
        ok(link1.url.endsWith(encodeURIComponent(param)), "Wrong path")
        #ok(link1.header ==  Cofe.utils.extractFilename(param), "Header unmatched")
        ok(link1.rel = "folder", "Rel unmatched")
        ok(link1.param = "{cofe}/test", "Param unmatched")
        console.log(link1)
    )

    test("Test with paginate", () -> 
        Link = Cofe.Link
        
        param = "{cofe}/test"
        link2 = Link.fromPath(param, {page : "5,10"})
        console.log(link2)        
        ok(((link2.url).indexOf(encodeURIComponent("5,10")) != -1), "Wrong path")
        #ok(link2.header ==  Cofe.utils.extractFilename(param), "Header unmatched")
        ok(link2.rel = "folder", "Rel unmatched")
        ok(link2.param = "{cofe}/test", "Param unmatched")

    )
</script>
